#ifndef RSSITEM_H
#define RSSITEM_H

//includes
#include <QString>
#include <QTextStream>
#include <QMap>

#include "qrssglobals.h"

typedef QMap<QString, QString> QRssLeafData;

class RssLeaf
{

public:
	RssLeaf();
	~RssLeaf();

	void		addData( const QString& key, const QString& value );
	void		setName( const QString& name ){ m_name = name; };
	QString		name()
					{ return m_name; };
	void		setState( ItemState state ) const 
					{ m_state = state; };
	ItemState	state() const
					{ return m_state; };
		
	QString		value( const QString& key ) const;

	void		internalize( const QString& stream );
	void		externalize( QTextStream& stream );

	void		operator<<( QTextStream& stream );
	void		operator>>( QTextStream& stream );

	protected:
	QString		getNextItem( const QString& stream, bool newLiine = false );
	void		fillResource(QRssFType type);
	
private:

	QRssLeafData			m_itemData;
	QString					m_name;
	mutable ItemState		m_state;

};
#endif //RSSITEM_H
//eof
